package com.yyc.system.dao;

import java.util.List;

import org.apache.ibatis.annotations.Select;

import com.yyc.core.Mapper;
import com.yyc.system.model.TClassUser;

public interface TClassUserMapper extends Mapper<TClassUser> {

	@Select("SELECT a.*,b.user_name FROM t_class_user a JOIN t_user b ON a.user_id = b.id AND a.role = '02' WHERE a.class_id = #{classId}")
	List<TClassUser> getClassStudent(Integer classId);

	@Select("SELECT a.user_name,a.account,c.class_name FROM t_user a INNER JOIN t_class_user b ON a.id = b.user_id LEFT JOIN t_class c ON b.class_id = c.id WHERE a.role = 01")
	List<TClassUser> getStudentList();
}